﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("-----------欢 迎 进 入 游 戏 世 界------------");
            while (true)
            {
                Console.WriteLine("****************************");
                Console.WriteLine("**********猜拳开始**********");
                Console.WriteLine("****************************");
                Console.WriteLine("出拳规则：1.剪刀 2.石头 3.布");
                Users users = UsersCreate();
                Hero hero = new Hero();
                hero.HeroCreate();
                
                bool IsStart = Start();
                if (!IsStart)
                {
                    Console.WriteLine("系统退出");
                    return;
                }
                else
                {
                    Console.WriteLine(users.Name + " VS " +  hero.Name+ "  对战");
                }
                GameSystem game = new GameSystem();
                bool IsConutinue = game.Gaming(hero, users);
                if (!IsConutinue)
                {
                    Console.WriteLine("系统退出");
                    return;
                }
            }




        }

        private static Users UsersCreate()
        {

            Console.WriteLine("请输入您的姓名");
            string usersName = Console.ReadLine();
            return new Users(usersName);
        }

        private static bool Start()
        {
            while (true)
            {
                Console.WriteLine("开始游戏吗？（y/n）");
                string chioce = Console.ReadLine();
                switch (chioce)
                {
                    case "y":
                        return true;
                    case "n":
                        return false;
                    default:
                        Console.WriteLine("选择错误，请重新输入");
                        continue;
                }
            }
        }
    }
}